#include <stdio.h>
main()
{
int n;
float a,b,s;
scanf("%d",&n);
while (n--)
{
scanf("%f%f",&a,&b);
for (s=1;;s++)
if (int(s*a/100)<int(s*b/100))
break;
printf("%d\n",int(s));    
}
}
